package com.lwei.ljpro.util;

import java.util.Calendar;
import java.util.Date;

/**
 * 日期工具类
 * @author sks.lwei
 */
public class DateUtil {


    public static Date today(){

        return new Date();
    }

    public static Date today(Date select){
        return new Date();
    }

    /**
     * 获取当天的下午18:00
     * @return date
     */
    public static Date todayEnd(){
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(today());
        calendar.set(Calendar.HOUR_OF_DAY, 18);
        calendar.set(Calendar.MINUTE, 0);
        return calendar.getTime();
    }

    public static Date tomorrow(){
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(today());
        calendar.add(Calendar.DATE, 1);
        return calendar.getTime();
    }

    public static int getDay(Date date){
        if(date == null){
            return 0;
        }
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar.get(Calendar.DATE);
    }
}
